﻿Namespace Compras
    Public Class FrmOrdenCompraProductoConfirmacionPopup

        Public Property ProductoID As Integer = -1

        Public Property CAntidad As Decimal = 0
        Public Property Precio As Decimal = 0.0


        Private Sub btn_NoCobrar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
            Me.DialogResult = Windows.Forms.DialogResult.Retry
            Me.Close()
        End Sub

        Private Sub FrmOrdenProductoConfirmacion_Shown(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Shown
            If ProductoID > 0 Then

                Dim ent As Farmacia.Entity.Producto.Producto
                Dim obj As New Farmacia.Business.Producto.Producto
                ent = obj.Listar(ProductoID)


                Me.txt_producto.Text = ent.Nombre
                Me.txt_concentracion.Text = ent.Concentracion
                Me.txt_presentacion.Text = ent.Presentacion
                Me.txt_forma.Text = ent.FormaSimpleNombre
                Me.txt_marca.Text = ent.MarcaNombre
                Me.txt_precio.Text = "0.0"
                Me.txt_precio.Focus()

            End If
        End Sub

        Private Sub btn_aceptar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_aceptar.Click
            Confirmar()
            Me.DialogResult = Windows.Forms.DialogResult.OK
            Me.Close()
        End Sub
        Public Sub Confirmar()
            CAntidad = Me.nud_cantidad.Value
            Precio = Me.txt_precio.Text
        End Sub


        Private Sub FrmOrdenProductoConfirmacion_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

        End Sub




        Private Sub btn_NoCobrar_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCancelar.Click
            Me.DialogResult = Windows.Forms.DialogResult.Cancel
            Me.Close()
        End Sub
    End Class
End Namespace
